<!DOCTYPE html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" >
<head>
	<th:block th:include="include :: header('定时任务详情')" />
</head>
<body class="white-bg">
	<div class="wrapper wrapper-content animated fadeInRight ibox-content">
	
	<form class="form-horizontal m-t" id="jobLogForm" th:if="${name == 'jobLog'}">
	    <div class="form-group">
			<label class="col-sm-3 control-label">日志序号：</label>
			<div class="form-control-static" th:text="${jobLog.jobLogId}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">任务名称：</label>
			<div class="form-control-static" th:text="${jobLog.jobName}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">执行类名：</label>
			<div class="form-control-static" th:text="${jobLog.className}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">参数：</label>
			<div class="form-control-static"><pre id="jobParams"></pre></div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">Cron表达式：</label>
			<div class="form-control-static" th:text="${jobLog.cron}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">运行时长：</label>
			<div class="form-control-static" th:text="${jobLog.runTime}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">创建时间：</label>
			<div class="form-control-static" th:text="${#dates.format(jobLog.createTime, 'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">执行状态：</label>
			<div class="form-control-static" th:class="${jobLog.status == 1 ? 'label label-primary' : 'label label-danger'}" th:text="${jobLog.status == 1 ? '正常' : '失败'}">
			</div>
		</div>
		<div class="form-group" th:style="'display:' + ${jobLog.status == 1 ? 'none' : 'block'}">
			<label class="col-sm-3 control-label">异常信息：</label>
			<div class="form-control-static" th:text="${jobLog.exception}">
			</div>
		</div>
		<th:block th:include="include :: footer" />
		<th:block th:include="include :: jsonview-js" />
		<script th:inline="javascript">
			$(function() {
				var json = JSON.stringify([[${jobLog.jobParams}]]);
				if ($.common.isNotEmpty(json) && json.length < 2000) {
					$("#jobParams").JSONView(json);
				} else {
					$("#jobParams").text(json);
				}
			});
		</script>
	</form>

	<form class="form-horizontal m-t" id="jobForm" th:if="${name == 'job'}">
	    <div class="form-group">
			<label class="col-sm-3 control-label">任务序号：</label>
			<div class="form-control-static" th:text="${job.jobId}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">任务名称：</label>
			<div class="form-control-static" th:text="${job.jobName}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">执行类名：</label>
			<div class="form-control-static" th:text="${job.className}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">参数：</label>
			<div class="form-control-static"><pre id="jobParams"></pre></div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">执行表达式：</label>
			<div class="form-control-static" th:text="${job.cron}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">下次执行时间：</label>
			<div class="form-control-static" th:text="${#dates.format(job.nextValidTime, 'yyyy-MM-dd HH:mm:ss')}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">任务状态：</label>
			<div class="form-control-static" th:class="${job.paused ? 'label label-danger' : 'label label-primary'}" th:text="${job.paused ? '暂停' : '正常'}">
			</div>
		</div>
		<div class="form-group">
			<label class="col-sm-3 control-label">备注：</label>
			<div class="form-control-static" th:text="${job.remark}">
			</div>
		</div>
		<th:block th:include="include :: footer" />
		<th:block th:include="include :: jsonview-js" />
		<script th:inline="javascript">
			$(function() {
				var json = JSON.stringify([[${job.jobParams}]]);
				if ($.common.isNotEmpty(json) && json.length < 2000) {
					$("#jobParams").JSONView(json);
				} else {
					$("#jobParams").text(json);
				}
			});
		</script>
	</form>
    </div>
</body>
</html>